import { $hotel_get,$hotel_post } from "../utils/request.ts";

//返回角色列表
export const $roleList = async ()=>{
    let ret =await $hotel_get('role/findRole')
    return ret.t
}

//添加角色
export const $add = async (params:object)=>{
    let ret = await $hotel_post('role/save',params)
    return ret
}

//根据角色名和酒店id查找角色
export const $findRole = async (params:object) =>{
    let ret  = await $hotel_get('role/findByName',params)
    return ret
}

//查看角色下是否有员工
export const $findEmployeeRole = async(params:object) =>{
    let ret = await $hotel_get('employee/findByRole',params)
    return ret
}

//删除角色
export const $delete = async(params:object) =>{
    let ret = await $hotel_get('role/deleteRole',params)
    return ret
}

//根据角色id查找角色
export const $findRoleById = async(params:object) =>{
    let ret = await $hotel_get('role/findRoleById',params)
    return ret
}

//更新角色名称
export const $updateRole = async(params:object) =>{
    let ret = await $hotel_post('role/updateRole',params)
    return ret
}

export const $checkIfInitialAdmin = async(params:object) =>{
    let ret = await $hotel_get('role/IfInitialAdmin',params)
    return ret
}

//根据角色id查看权限
export const $findPowerById = async(params:object) =>{
    let ret = await $hotel_get('role/findPowerById',params)
    return ret
}

//查找全部权限
export const $findAllPower = async() =>{
    let ret = await $hotel_get('role/findAllPower')
    return ret
}




